package com.hooper.cmn.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hooper.hosp.model.cmn.Dict;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/09/26/19:43
 */
public interface DictService extends IService<Dict> {
    /**
     * get the children by their parent id
     * @param id the top node id (parent id)
     * @return
     */
    List<Dict> findChildrenById(Long id);

    /**
     * download the dict from the browser
     * @param response
     * @return
     */
    boolean downloadDict(HttpServletResponse response);

    /**
     * import an Excel file and insert the date to db
     * @param file
     * @return
     */
    boolean importDict(MultipartFile file);

    String getDictName(String dictCode, String value);

    List<Dict> getSubNode(String dictCode);
}
